package interfaces.menu;

import interfaces.GUISource;
import interfaces.language.LanguageButton;
import interfaces.superWidgets.InterfaceLabel;
import interfaces.superWidgets.InterfaceWindow;

import org.fenggui.decorator.background.PlainBackground;
import org.fenggui.event.ButtonPressedEvent;
import org.fenggui.event.IButtonPressedListener;
import org.fenggui.layout.RowLayout;
import org.fenggui.util.Color;

import fileHandling.language.interfaces.OptionsWindowText;
import gameStates.absGamesStates.gui.AbsMenuState;

public class MenuMessageWindow extends InterfaceWindow {
	
	public MenuMessageWindow(AbsMenuState menuState, String title, String message) {
		super(true, title);
		
		setXY(menuState.getWidth() / 5 * 2, menuState.getHeight() / 5 * 2);
		
		content.getAppearance().add(new PlainBackground(Color.LIGHT_CYUAN));
		content.setLayoutManager(new RowLayout(false));
		
		InterfaceLabel messageLabel = new InterfaceLabel(message, GUISource.bigFont);
		content.addWidget(messageLabel);
		
		LanguageButton okButton = new LanguageButton(OptionsWindowText.Ok, GUISource.bigFont);
		okButton.addButtonPressedListener(new IButtonPressedListener() {
			@Override
			public void buttonPressed(ButtonPressedEvent e) {
				close();
			}
		});
		content.addWidget(okButton);
		
		pack();
	}
}